#include <stdio.h>
int missingNumber(int* nums, int numsSize) {
    int N = numsSize;
    int ret = (0 + N) * (N + 1) / 2;
    for (int i = 0; i < numsSize; i++)
    {
        ret -= nums[i];
    }
    return ret;
}
int main()
{
    int nums[] = { 9,6,4,2,3,5,7,0,1 };
    int numsSize = sizeof(nums) / sizeof(nums[0]);
    int ret = missingNumber(nums, numsSize);
    printf("%d\n", ret);
	return 0;
}